package com.example03.test;

import com.example03.Manager;
import com.example03.Seller;

public class Service {
    public static void getTotalSalaries(Manager[] manager, Seller[] seller) {
        double endSela1 = 0;
        double endSela2 = 0;
        double endSela = 0;
        for(int i = 0; i < manager.length; i++) {
            endSela1 = endSela1 + manager[i].getBasicSela() * manager[i].getSelaAttribute() * 0.8;
            int j = i + 1;
            double sela1 = 0;
            System.out.println("经理" + j +  "金额" + "    " + endSela1);
            sela1 = sela1 + endSela1;
            System.out.println("经理总金额" + "  " + sela1);
        }
        for(int i = 0; i < seller.length; i++) {
            int j = i + 1;
            double sela2 = 0;
            endSela2 = endSela2 + seller[i].getBasicSela() + seller[i].getSalesVolume() * seller[i].getCommissionRate();
            System.out.println("销售员" + j +  "  " + endSela2);
            sela2 = sela2 + endSela2;
            System.out.println("销售员总金额" +  "  " + sela2);
        }
        endSela = endSela1 + endSela2;
        System.out.println("员工总金额" + "    "  + endSela);
    }
}